package com.itheima.test;

import com.itheima.dao.ClassesDao;
import com.itheima.domain.Classes;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.Test;

import java.util.List;

public class 一对多查询 {
    @Test
    public void testFindAll()throws Exception{
        SqlSession sqlSession = new SqlSessionFactoryBuilder().build(Resources.getResourceAsStream("mybatis-conﬁg.xml")).openSession();

        ClassesDao classesDao = sqlSession.getMapper(ClassesDao.class);

        List<Classes> all = classesDao.findAll();

        sqlSession.close();

        System.out.println(all);
    }
}
